public class Mean extends Alg implements Runnable {
	final int userID;
	final int itemID;

	Mean(int userID, int itemID) {
		this.userID = userID;
		this.itemID = itemID;
	}

	@Override
	public void run() {
		predict();
	}

	byte predict() {
		User user = USERA[userID];
		byte[] votes = user.votes;

		double sum = 0;

		for (byte vote : votes) {
			sum += (double) vote;
		}

		return (byte) (sum / votes.length);
	}
}

class Alg extends Setup {
	public static void main(String[] args) {
		setup();
		loop();
	}

	private static void loop() {
		for (int userID = 0; userID < 10; userID++) {
			User outputUser = USERB[userID];
			for (int i = 0; i < outputUser.ilen; i++) {
				int itemID = outputUser.items[i];
				new Thread(new Mean(userID, itemID)).start();
			}
		}
	}
}
